<html xmlns:x="http://www.w3.org/1999/html">
<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'center',border:false" style="overflow: hidden;padding: 3px;">
        <form id="accessLogAddForm" method="post">
            <table class="grid">
                <tr>
                    <td></td>
                    <td><input name="id" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                    <td></td>
                    <td><input name="accessDay" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="accessDaytime" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                    <td></td>
                    <td><input name="accessType" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="description" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                    <td></td>
                    <td><input name="deviceId" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="deviceType" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                    <td></td>
                    <td><input name="extranetIp" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="ip" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                    <td></td>
                    <td><input name="operateResult" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="osType" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                    <td></td>
                    <td><input name="queryString" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="requestTarget" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                    <td></td>
                    <td><input name="requestURI" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="reserved" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                    <td></td>
                    <td><input name="session2Id" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="time" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                    <td></td>
                    <td><input name="userAgent" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="userId" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                    <td></td>
                    <td><input name="username" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="contentType" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                    <td></td>
                    <td><input name="redisCookieId" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="secretKey" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                    <td></td>
                    <td><input name="accessKey" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="requestHeader" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true"></td>
                </tr>
            </table>
        </form>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $('#accessLogAddForm').form({
            url: basePath + '/accessLog/add',
            onSubmit: function () {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success: function (result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.code === 1) {
                    //之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为list页面预定义好了
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    var form = $('#accessLogAddForm');
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });
    });
</script>
